package com.trhui.mallbook.client;

import com.trhui.mallbook.domain.common.ApiRequest;
import com.trhui.mallbook.domain.common.BaseResponse;
import com.trhui.mallbook.domain.request.hf.HfQueryRealTimeWithdrawRequest;
import com.trhui.mallbook.domain.response.hf.HfQueryRealTimeWithdrawResponse;
import com.trhui.mallbook.enums.ChannelTypeEnum;
import com.trhui.mallbook.enums.ServerCodeEnum;

/**
 * 实时结算额度查询
 *
 * @author ljy
 */
public class QueryRealTimeWithdrawClient extends AbstractClient {

    /**
     * 汇付-实时结算额度查询
     *
     * @param request
     * @return
     */
    public static BaseResponse<HfQueryRealTimeWithdrawResponse> hfQueryRealTimeWithdraw(HfQueryRealTimeWithdrawRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.REAL_TIME_WITHDRAW_QUERY)
                .channelType(ChannelTypeEnum.HF)
                .build();
        return post(apiRequest, HfQueryRealTimeWithdrawResponse.class);
    }

}
